/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
describe("ui behaviour", function() {
    beforeEach(function() {
        ui = new UI();
        spyOn(ui.fsm, 'startup');
        loadStyleFixtures("test/public_html/styles.css");
        loadFixtures("test/test/spec/javascripts/fixtures/basic_components.html");

        ui.startup();
        expect(ui.fsm.startup).toHaveBeenCalled();
    });
    it("should", function() {
        //expect(jQuery('#player').css('z-index')).toEqual('-2');
        var content = jQuery('#content');
        expect(content.css('display')).toEqual('none');
        ui.fsm.current = 'breadcrumbSelect';
        runs(function() {
            console.log("initial run");
            ui.fsm.onchangestate();
        });
        //;
        var done = false;
        waitsFor(function() {
            console.log("waits for");
            done = !content.is(":animated");
            return done;
        }, "waiting for end of animation", 5000);

        runs(function() {
            console.log("end run");
            expect(content.css('left')).toEqual('400px');
        });
    });

});

